﻿using System;
using WhiteMagic;

namespace WardenMonitor
{

    public static class Warden
    {
        private static readonly Magic _magic = new Magic();

        private const int Rc4KeysOffset = 0x20;
        private const int Rc4KeySize = 0x102;

        public static IntPtr ClassPointer = new IntPtr(0x00D31A4C);
        public static IntPtr MessageHandler = new IntPtr(0x007DA850);
        public static IntPtr SendPacket = new IntPtr(0x007DAAB0);

        public static byte[] GetKeyOut()
        {
            return _magic.ReadBytes(_magic.ReadStruct<uint>(ClassPointer) + Rc4KeysOffset, Rc4KeySize);
        }

        public static byte[] GetKeyIn()
        {
            return _magic.ReadBytes(_magic.ReadStruct<uint>(ClassPointer) + Rc4KeysOffset + Rc4KeySize, Rc4KeySize);
        }
    }

}